import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/test',
    component: () => import('../views/test.vue')
  },
  {
    path: '/login',
    component: () => import('../views/login.vue')
  },
  {
    path: '/reg',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/forgotPass',
    component: () => import('../views/forgotPass/ForGotPass.vue')
  },
  {
    path: '/forgotPass2',
    component: () => import('../views/forgotPass/ForGotPass2.vue')
  },
  {
    path: '/',
    component: () => import('../views/AdminIndex.vue'),
    redirect:"/sys-admin/center",
    children:[
      {
        path: '/sys-admin/admin',
        component: () => import('../views/sys-admin/SystemAdmin.vue')
      },
      {
        path: '/sys-admin/center',
        component: () => import('../views/sys-admin/SystemPersonalCenter.vue')
      },
      {
        path: '/sys-admin/updatePass',
        component: () => import('../views/sys-admin/SystemAdminUpdatePass.vue')
      },
      {
        path: "/sys-admin/notice",
        component: () => import('../views/sys-admin/SystemNotice.vue')
      },
      {
        path: '/sys-admin/slideshow',
        component: () => import('../views/sys-admin/SystemSlideshow.vue')
      },
      {
        path: "/sys-admin/user",
        component: () => import('../views/sys-admin/SystemUser.vue')
      },
      {
        path: "/sys-admin/forum",
        component: () => import('../views/sys-admin/SystemForum.vue')
      },
      {
        path: "/sys-admin/returnHome",
        component: () => import('../views/sys-admin/SystemReturnHome.vue')
      },
      {
        path: '/sys-admin/distribution',
        component: () => import('../views/sys-admin/CommodityDistribution')
      },
      {
        path: '/sys-admin/purchase',
        component: () => import('../views/sys-admin/CommodityPurchase')
      }
    ]
  },
  {
    path: '/user',
    component: () => import('../views/UserIndex.vue'),
    redirect:"/sys-user/index",
    children:[
      {
        path: '/sys-user/returnHome',
        component: () => import('../views/sys-user/UserReturnHome.vue')
      },
      {
        path: '/sys-user/returnHomeAddNew',
        component: () => import('../views/sys-user/ReturnHomeAddNew.vue')
      },
      {
        path: '/sys-user/returnHomeUpdate',
        component: () => import('../views/sys-user/ReturnHomeUpdate.vue')
      },
      {
        path: '/sys-user/updatePass',
        component: () => import('../views/sys-user/SystemUserUpdatePass.vue')
      },
      {
        path: '/sys-user/index',
        component: () => import('../views/sys-user/SystemUserIndex.vue')
      },
      {
        path: '/sys-user/forum',
        component: () => import('../views/sys-user/SystemUserForum.vue')
      },
      {
        path: '/sys-user/forumStandard',
        component: () => import('../views/sys-user/UserForumStandard.vue')
      },
      {
        path: '/sys-user/takeaway',
        component: () => import('../views/sys-user/SystemUserTakeaway.vue')
      },
      {
        path: '/sys-user/healthy',
        component: () => import('../views/sys-user/SystemUserHealthy.vue')
      },
      {
        path: '/sys-user/userCenter',
        component: () => import('../views/sys-user/SystemUserPersonalCenter.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router


